<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>form</title>
</head>
<body>
    <!-- <form action="https://www.sogou.com/index.html" method="post">
        <input type="text" name="username">
        <input type="password" name="password">
        <input type="submit" value="提交">
    </form> -->
<!-- post 第一种请求方式 -->
    <form action="postGetParameter" method="post">
        <input type="text" name="userId">
        <input type="text" name="classId">
        <input type="submit" value="提交">

        <!-- <input type = "text" id="userId">
        <input type="text" id="classId">
        <input type="button" value="提交" id="submit"> -->
    </form>
<script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
<script>
    // $.ajax({
    //     type:'get',
    //     url:'https://www.sogou.com/index.html',
    //     success:function(body){
    //         console.log("获取到响应数据！" + body);
    //     },
    //     error:function(){
    //         console.log("获取响应失败");
    //     }
    // });
    // let usernameInput = document.querySelector('#userId');
    // let classIdInput = document.querySelector('#classId');
    // let button = document.querySelector('#submit');
    // button.onclick = function(){
    //     $.ajax({
    //         type:'post',
    //         url: 'postParaneter',
    //         data: JSON.stringify({
    //             userId:userIdInput,
    //             classId:classIdInput,
    //         }),
    //         success:function(body){
    //             cosole.log(body);
    //         }
    //     });
    // }
        
</script>
</body>
</html>